//
//  GKLoginViewController.m
//  寻宝之旅
//
//  Created by GK on 16/4/2.
//  Copyright © 2016年 GK. All rights reserved.
//

#import "GKLoginViewController.h"
#import "GKViewController.h"
#import "XKStatusController.h"
#import "MBProgressHUD+PKX.h"
#import "XBSaveDataTool.h"

@interface GKLoginViewController ()
@property (weak, nonatomic) IBOutlet UITextField *lblPhone;
@property (weak, nonatomic) IBOutlet UITextField *lblCode;

@end

@implementation GKLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationController setNavigationBarHidden:NO];
}


//点击登录
- (IBAction)clickLogin:(UIButton *)sender
{
    if ([self.lblPhone.text isEqualToString:@"123"] && [self.lblCode.text isEqualToString:@"123"])
    {
        [MBProgressHUD showSuccess:@"登录成功"];
        //保存登录
        BOOL success = YES;
        [XBSaveDataTool saveBool:success forKey: loginStause ];
        
        //延时1s退出
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self dismissViewControllerAnimated:YES completion:nil];
        });
        
        
    }
    else
        [MBProgressHUD showError:@"账号密码错误"];
}



@end
